<?php 
$this->jQuery()->enable();
$this->headLink()->prependStylesheet('/js/jquery/css/themes/base/jquery.ui.all.css');
$this->headScript() ->appendFile('/js/jquery/jquery-ui-1.8.12.custom.min.js')
					->appendFile('/js/jquery/ui/jquery.ui.widget.js')
					->appendFile('/js/jquery/ui/jquery.ui.core.js')					
					->appendFile('/js/jquery/ui/jquery.ui.dialog.js')					
					->appendFile('/js/jquery/ui/jquery.ui.draggable.js')
					->appendFile('/js/jquery/ui/jquery.ui.position.js')
					->appendFile('/js/jquery/ui/jquery.ui.resizable.js')
					->appendFile('/js/jquery/ui/jquery.ui.mouse.js')
					->appendFile('/js/jquery/ui/jquery.ui.button.js')					
					->appendFile('/js/geralAjax.js');
					

$this->headScript()->appendScript("
$(document).ready(function(){
 $('#confirme').dialog({
        height: 140,
        autoOpen: false,
        modal: true,
        resizable: false});
        $('input#btn-add-novo-email').button();               
      
});");
$translator = Zend_Registry::get('translator');
?>
<div id="flash-messeger"><?php echo $this->flashMessenger(); ?></div>
<div id="mapa">Configurações de Base/Lista/<span>Exibir E-mails</span></div>
<div align="right">
<span id="relacao-emails"><?php echo 'Relação de e-mails da Lista: <strong>'.$this->lista.'</strong>';?></span>	
	<a title="Adicionar e-mail" href="
		<?php echo $this->url(array(
			'action' => 'add',
			'controller' => 'emails',
			'module' => 'admin'));
		?>"><input type="button" value="Adicionar Email" id="btn-add-novo-email" name="btn-add-novo-email" >
	</a>
</div>
<table class="grid">
	<thead>
		<tr>
			
			<th>E-mail</th>
			<th>Optin</th>
			<th>Ações</th>
			
		</tr>
	</thead>
	<tbody>
       <?php foreach ($this->listaListaPaginacao as $email) :?>
        <tr>
			
			<td><?php echo $email['email'];?></td>
			<td width="10%" align="center" ><?php if($email['optin']==1){?><img border="0" src="/imagens/icons/tick.png"><?php }else{?><img border="0" src="/imagens/icons/cross.png"><?php };?></td>
			<td class="opcoes" width="10%">
				<a title="Editar" href="
					<?php echo $this->url(array(
						'action' => 'editar', 
						'controller' => 'emails',
						'module' => 'admin', 
						'id' => $email['idemail']));
					?>"><img border="0" src="/imagens/icons/email_edit.png"></a> |
					
				<a title="Excluír" href="javascript:void(0);" 
					onclick="poup('/admin/listas/excluiremail/idemail/<?php echo $email['idemail']?>/idlista/',<?php echo $email['idlista'];?>);"
					><img border="0" src="/imagens/icons/email_delete.png"></a></td>
		</tr>
        <?php endforeach;?>
    </tbody>
</table>
<?php echo $this->paginationControl($this->listaListaPaginacao, 'Sliding', 'paginacao.phtml');?>
<div id="confirme" title="<?php echo $translator->_('EXCLUIR_EMAIL');?>">
	<p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span><?php echo $translator->_('DELETAR_EMAIL_LISTA');?></p>
</div>